#ifndef _PLANET_H
#define _PLANET_H

class kPlanet {
	public:
		//name, size, habitat, type, population
		kPlanet(char*,int,int,int,int);
		~kPlanet();
		
		//generic getters
		inline const char *name();
		inline const int size();
		inline const int habitat();
		inline const int type();
		inline const int population();
		inline const kPlayer *player();
		inline const int numberOrders();
		inline const kPlanetOrder *order(int);
		inline const int numberShips();
		inline const kShip *ship(int);
		inline const int numberFacilities();
		inline const kFacilitiy *facility(int);
		
		int addPopulation(int);
		int removePopulation(int);
		
		bool assignOrder(kPlanetOrder*);
		//remove the first order
		bool removeOrder();
		//remove an order somewhere in 
		bool removeOrder(int);
		
		//returns the order after it's been carried out
		//if it is completed, something should be done,
		//otherwise move along
		kPlanetOrder *carryOutOrder();
		
		//create a new fleet at the given system (should
		//be home system - so check to make sure this
		//planet is in the system's list of planets?)
		void createFleet(kSystem*);
		
		//give control of the planet to the specified player
		void assignControl(kPlayer*);
		
		//planet allegiance modifier objects
		//to control a planet, you need to have 100 more allegiance
		//than any other player
		void addAllegiancePlayer(kPlayer*, int);
		kAllegiance *allegiancePlayer(kPlayer*);
		
		//determine maximum population
		int maxPopulation();
		
	private:
		char *pname;
		int psize;
		int phabitat;
		int ptype;
		int ppopulation;
		kPlayer *pcontrol;
		int pnumberorders;
		kPlanetOrder *porder;
		//list of ships mothballed on the planet
		//when planets build ships, they are added to
		//this list
		int pnumbermothball;
		kShip *pmothball;
		//list of allegiances to players in contact with this planet
		map<kPlayer*, kAllegiance*, bool(*)(kPlayer*,kPlayer*)> pallegiences;
		kFacility *pfacilities;
};

#endif